package com.wzy.controller;


import com.wzy.entity.Student;
import com.wzy.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author astupidcoder
 * @since 2022-01-24
 */
@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private IStudentService studentService;

    @RequestMapping("/add")
    public String saveStudent() {
        Student student = new Student();
        student.setAge(5);
        student.setHobby("Coding");
        student.setName("张三");
        boolean save = studentService.save(student);
        return save ? "成功" : "失败";
    }

}
